package com.zyz.G_常用类.BigDecimal;

import java.math.BigDecimal;

/**
 * @author: vick
 * @Date: 2025/3/19
 * @Description:
 * @version: 1.0
 */
public class Demo1 {
    public static void main(String[] args) {
        BigDecimal num1 = new BigDecimal("10.5");
        BigDecimal num2 = new BigDecimal("2.5");

        //加法运算
        BigDecimal sum = num1.add(num2);
        System.out.println(sum);

        //减法运算
        BigDecimal diff = num1.subtract(num2);
        System.out.println(diff);

        //乘法运算
        BigDecimal multiply = num1.multiply(num2);
        System.out.println(multiply);

        //除法运算
        BigDecimal divide = num1.divide(num2);
        System.out.println(divide);
    }
}
